      SUBROUTINE OUTP (ROTA, ROTR, T, Y, RC, XMU, PRTRAJ)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      COMMON /TEST/ ATABLE, LASTIT, RESSQ, DEBUG, SCPLOT, LASTPR, NCYCLE
      COMMON /TLONG/ PHLONG, PHLAT, PHALT
      COMMON /WOW/ F
      LOGICAL PRTRAJ, ATABLE, LASTIT, DEBUG, SCPLOT, LASTPR
      REAL PHLONG, PHLAT, PHALT
      DIMENSION Y(6),OE(12),X(3)
      REAL RESSQ
      DATA CO /.1745329251994430D-1/, M /6/
      IF (.NOT. LASTPR) RETURN
      TPR=T/6.D1
      IF (.NOT. PRTRAJ) GO TO 10
      IF(NPRINT.LT.8.AND.T.GT.0.D0)GO TO 1
      NPRINT=0
      WRITE(6,50)
   50 FORMAT(1H1)
    1 WRITE(M,500)TPR,Y
      NPRINT=NPRINT+1
   10 CALL OSCUL (2, T, XMU, Y, OE)
      F=DATAN2(DSQRT(1.D0-OE(2)*OE(2))*OE(11),(OE(12)-OE(2)))/CO
      W=DATAN2(OE(6),OE(7))/CO
      EI=DATAN2(OE(4),OE(5))/CO
      OM=DATAN2(OE(8),OE(9))/CO
      TAU=(ROTA+ROTR*T)*CO
      STAU=DSIN(TAU)
      CTAU=DCOS(TAU)
      X(1)=Y(1)*CTAU+Y(3)*STAU
      X(2)=-Y(1)*STAU+Y(3)*CTAU
      X(3)=Y(5)
      RHO=DSQRT(Y(1)*Y(1)+Y(3)*Y(3)+Y(5)*Y(5))
      PH=DATAN2(X(2),X(1))/CO
      PHLONG = SNGL(PH)
      TH=DASIN(X(3)/RHO)/CO
      PHLAT = SNGL(TH)
      ALT=RHO-RC
      PHALT = ALT
      IF (.NOT. PRTRAJ) RETURN
      WRITE(M,501)OE(1),OE(2),EI,W,OM,F,TH,PH,ALT,RHO
  501 FORMAT(1H 'A='F10.4,2X'E='F6.4,2X'I='F11.6,2X'W='F11.6,2X'OM='F11.
     16,2X'F='F8.3,2X'LAT='F6.2,2X'LON='F7.2,1X'ALT='F8.2,2X'R='F8.2)
  500 FORMAT(1H0'TIME='F8.2,'(MIN.)'/ ' X='D15.8,'  XD='D15.8,'   Y='
     1D15.8,'  YD='D15.8,'   Z='D15.8,'  ZD='D15.8)
      RETURN
      END
